package chixing.day18.synchronized_demo;
public class AccountTest {
    public static void main(String[] args) throws InterruptedException {
        Account account = new Account("123456", 1000);
        for (int i = 0; i <1000; i++) {
            AccountTread accountTread = new AccountTread(account);
            accountTread.start();
        }

        // 等待所有线程完成
        Thread.sleep(10000);
        // 此时再打印余额
        System.out.println(account.getBalance());
    }
}

